/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2020-09-06
 * Time: 20:42
 */
#include <iostream>
#include <thread>
using namespace std;

class no_copies{
public:
    no_copies(){};

private:
    no_copies(no_copies const &) = delete;
    no_copies & operator=(no_copies const &) = delete;
};

/**
 * @brief 仅移动类
 */
class move_only{
private:
    std::unique_ptr<my_class> data;

public:
    move_only(const move_only &) = delete;
    
    move_only(move_only &&other)
        : data(std::move(other.data))
    {
    
    }
    
    move_only & operator=(const move_only &) = delete;
    
    move_only & operator=(move_only && other){
        data = std::move(other.data);
        return *this;
    }
};

int main(){
  
    no_copies a;
    //no_copies b(a);
    
    move_only m1;
    move_only m2(m1);       //拷贝构造函数声明为“delete”
    move_only m3(std::move(m1));
    return 0;
}